<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>建议使用信管帮APP</title>
    <link rel="icon" href="https://XGStudio2023.github.io/download/images/appstore1/Xlogo.webp">
    <link rel="stylesheet" href="../../css/header.css">
    <script>
        function ftj(){
        var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?bf7c9dd09dc20e82b0fcb28872ddb927";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
        }
        ftj()

</script>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        html,body{
            height: 100%;



            -webkit-user-select:none;
            -moz-user-select:none;
            -ms-user-select:none;
            user-select:none;
        }
        ul li{
            list-style: none;
        }
        ::-webkit-scrollbar{
            width: 0rem;
        }
        body{
            background: #f6f6f6a1;
            display: flex;
            flex-direction: column;
            
            
        }
        section{
            /*
            border: 1px solid red;*/

            
            /**/

            flex: 1;
            /*
            display: flex;
            justify-content: center;*/
            /*部分安卓真机header不显示
            min-height: fit-content;*/
            overflow-y: scroll;

        }
        .container .t{
            /*
            border: 1px solid red;*/
            margin-left: 5%;
            font-size: .3865rem;/*16px*/
            color: #929292;
        }
        .container .ul1{
            /*
            border: 1px solid red;*/
            border-radius: .1208rem;/*5px*/
            /*
            box-shadow: .2415rem .2415rem .2415rem rgb(190, 190, 190);
            */
            width: 90%;
            font-size: .3865rem;/*16px*/
            line-height: 1.087rem;/*45px*/
            margin: .2415rem auto;
        }
        .container .ul1 li{
            /*
            border: 1px solid red;*/
            height: 1.087rem;/*45px*/
            /*
            text-align: center;*/
            border-bottom: .0121rem solid rgba(185, 185, 185, 0.429);
        }
        .container .ul1 li:nth-child(even){
            background-color: #f2f2f2;
        }
        .container .ul1 li:nth-child(odd){
            background-color: #b3e7ff70;
        }
        .container .ul1 li:first-child{
            border-radius: .1208rem .1208rem 0 0;/*5px*/
        }
        .container .ul1 li:last-child{
            border-radius: 0 0 .1208rem .1208rem;/*5px*/
        }
        .ul1 li span:nth-child(1){
            /*
            border: 1px solid red;*/
            display: inline-block;
            width: 55%;
            color: #363636;
            margin-left: .6039rem;/*25px*/
        }
        .ul1 li span:nth-child(2){
            /*
            border: 1px solid rgb(0, 255, 81);*/
            display: inline-block;
            color: #59a4fffa;
            
            letter-spacing: .0242rem;
            font-weight: 600;
        }
        textarea{
            box-sizing: border-box;
            border-radius: .1208rem;/*5px*/
            width: 90%;
            margin: .1932rem 5%;
            padding: .2415rem;
            
        }
        .copyBtn{
            width: 4.8309rem;/*200px*/
            height: 1.2077rem;/*50px*/
            border: none;
            border-radius: .6039rem;
            background: #4099ff;
            color: #fff;
            font-size: .4348rem;/*18px*/
            margin-left: 50%;
            margin-bottom: .9662rem;
            transform: translateX(-2.4155rem);
            letter-spacing: .0483rem;
            
        }
        
        
    </style>
</head>
<body>
    <header>
        <div class="backBtn"></div>
        <div class="left"></div>
        <span class="title">实验四</span>
    </header>
    <script>
        document.querySelector(".backBtn").onclick=function(){
            ftj()
		window.history.go(-1)
        }
        /*
        document.querySelector(".right").onclick=function(){
            window.location.replace('./index.html')
        }*/
    </script>

    <section>
        <div class="container">
            <!-- 编程题 -->
            <span class="t">编程题</span>
            <br>
            <span class="t">7-1 统计学生成绩</span>
            <br>
            <textarea name="" id="txt1" cols="30" rows="10">#include <stdio.h>
int main()
{
    int N, A = 0, B = 0, C = 0, D = 0, E = 0;
    scanf("%d", &N);
    int score[N];
    for( int i=0; i<N; i++){
        scanf(" %d", &score[i]);
        if( score[i] < 60 )
            E++;
        else if( score[i] >= 60 && score[i] < 70 )
            D++;
        else if( score[i] >= 70 && score[i] < 80 )
            C++;
        else if( score[i] >= 80 && score[i] < 90 )
            B++;
        else
            A++;
    }
    printf("%d %d %d %d %d", A, B, C, D, E);
    return 0;
}</textarea>
            <br>
            <button id="copyBtn1" class="copyBtn" onclick="copy1()">一键复制</button>


            <!-- 复制 -->
            <script>
                function copy1() {
                    var element = document.getElementById("txt1");
                    var copyBtn = document.getElementById("copyBtn1");
                    element.select();
                    element.setSelectionRange(0, element.value.length);
                    document.execCommand('copy');
                    copyBtn.style.background='#c0c0c0'
                    copyBtn.innerHTML='已复制'
                    setTimeout(function(){
                        copyBtn.style.background='#4099ff'
                        copyBtn.innerHTML='一键复制'
                    },2000)
                }
            </script>

            <span class="t">7-2 奇偶分家</span>
            <br>
            <textarea name="" id="txt2" cols="30" rows="10">#include <stdio.h>
int main()
{
    int N = 0;
    int n = 0;
    int j = 0;
    int s = 0;
    scanf("%d", &N);
    for (int i = 0; i < N; i++)
    {
        scanf("%d", &n);
        if (n % 2 == 0)
        {
            s++;//偶数的个数
        } else {
            j++;//奇数的个数
        }
    }
    printf("%d %d", j, s);
    return 0;
}</textarea>
            <br>
            <button id="copyBtn2" class="copyBtn" onclick="copy2()">一键复制</button>


            <!-- 复制 -->
            <script>
                function copy2() {
                    var element = document.getElementById("txt2");
                    var copyBtn = document.getElementById("copyBtn2");
                    element.select();
                    element.setSelectionRange(0, element.value.length);
                    document.execCommand('copy');
                    copyBtn.style.background='#c0c0c0'
                    copyBtn.innerHTML='已复制'
                    setTimeout(function(){
                        copyBtn.style.background='#4099ff'
                        copyBtn.innerHTML='一键复制'
                    },2000)
                }
            </script>

            <span class="t">7-3 念数字</span>
            <br>
            <textarea name="" id="txt3" cols="30" rows="10">#include <stdio.h>
int count(int x);
int main()
{
  int n;
  if(scanf("%d",&n)){};//输入要读的整数
  int c;
  if(n<0)
  {
  	printf("fu ");
  	n=-n;
  }//当输入的整数为负数时，取负数的相反数
  c=count(n);
  for(int i=0;c>0;i++)//循环的控制条件为c>0,之前写成了n>0
  {
    int m;
    m=n/c;//取出该整数的第一位数字
    n%=c;
    switch (m)
	{ 
    case 0:
        printf("ling");
        break;
    case 1:
        printf("yi");
        break;
    case 2:
        printf("er");
        break;
    case 3:
        printf("san");
        break;
    case 4:
        printf("si");
        break;
    case 5:
        printf("wu");
        break;
    case 6:
        printf("liu");
        break;
    case 7:
        printf("qi");
        break;
    case 8:
        printf("ba");
        break;
    case 9:
        printf("jiu");
    }
        if(c>9)//判断点，控制最后输出没有空格
		{
        	printf(" ");
		}
    c/=10;
  }
  return 0;
}
int count(int x)//例如-400，则返回值为100
{
	int cnt=1;
	while(x>9)
	{
	    x/=10;
	    cnt*=10;
	}
	return cnt;
}</textarea>
            <br>
            <button id="copyBtn3" class="copyBtn" onclick="copy3()">一键复制</button>


            <!-- 复制 -->
            <script>
                function copy3() {
                    var element = document.getElementById("txt3");
                    var copyBtn = document.getElementById("copyBtn3");
                    element.select();
                    element.setSelectionRange(0, element.value.length);
                    document.execCommand('copy');
                    copyBtn.style.background='#c0c0c0'
                    copyBtn.innerHTML='已复制'
                    setTimeout(function(){
                        copyBtn.style.background='#4099ff'
                        copyBtn.innerHTML='一键复制'
                    },2000)
                }
            </script>

            <span class="t">7-4 比较大小</span>
            <br>
            <textarea name="" id="txt4" cols="30" rows="10">#include <stdio.h>
int main()
{
    int a, b, c, min;
    scanf("%d %d %d", &a, &b, &c);
    if (a > b) {
        min = a;
        a = b;
        b = min;
    }
    if (a > c) {
        min = a;
        a = c;
        c = min;
    }
    if (b > c){
        min = b;
        b = c;
        c = min;
    }
    printf("%d->%d->%d", a, b, c);
    return 0;
}</textarea>
            <br>
            <button id="copyBtn4" class="copyBtn" onclick="copy4()">一键复制</button>


            <!-- 复制 -->
            <script>
                function copy4() {
                    var element = document.getElementById("txt4");
                    var copyBtn = document.getElementById("copyBtn4");
                    element.select();
                    element.setSelectionRange(0, element.value.length);
                    document.execCommand('copy');
                    copyBtn.style.background='#c0c0c0'
                    copyBtn.innerHTML='已复制'
                    setTimeout(function(){
                        copyBtn.style.background='#4099ff'
                        copyBtn.innerHTML='一键复制'
                    },2000)
                }
            </script>


        </div>
    </section>
    






    
    <script>
        //根据设备宽度计算html的font-size
        function resetHtmlFont(){
            //获取html对象并动态设置font-size = 设备宽度的1/10
            document.documentElement.style.fontSize = screen.width/10 + 'px';
        }
        //执行一下
        resetHtmlFont();
        //如果窗口大小改变了，则重新计算基础font-size
        window.onresize = resetHtmlFont;
    </script>
</body>
</html>
